package com.cy.jxc.service.impl;

import com.cy.jxc.MyException.ServiceExecption;
import com.cy.jxc.dao.GoodDao;
import com.cy.jxc.entity.Goods;
import com.cy.jxc.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl  implements GoodsService {
    @Autowired
    GoodDao goodDao;
    @Override
    public List<Goods> findAllGoods() {
        List<Goods> rows = goodDao.findAllGoods();
        if(rows==null)
            throw new ServiceExecption("查询不到对应的记录");
        return rows;
    }
}
